home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Online / CallMan / Install < prev    next >
Encoding:
Text File  |  1998-02-23  |  16.5 KB  |  405 lines

  1. ; ****************************************************************************
  2. ; *                                                                          *
  3. ; *  'CallMan' Install-Script                                                *
  4. ; *  written 1997-1998 by Alexander 'Sascha' Fichtner                        *
  5. ; *                                                                          *
  6. ; *  $VER: CallMan Installer 1.3 (23.02.98)                                  *
  7. ; *                                                                          *
  8. ; *  This installer script is freeware! :-)                                  *
  9. ; *  You may use it (or parts of it) in your own installer scripts...        *
  10. ; *                                                                          *
  11. ; *  You are NOT allowed to ask ANY monetary charge for it!                  *
  12. ; *                                                                          *
  13. ; *  Feel free to send any comments/bugreports to:                           *
  14. ; *                                                                          *
  15. ; *    fichtner@informatik.tu-muenchen.de                                    *
  16. ; *                                                                          *
  17. ; ****************************************************************************
  18.  
  19. (if (= @language "english")
  20.     (
  21.         (set #default_language 1)
  22.         (set #default_language_guide 0)
  23.         (set #language                    "English")
  24.         (set #welcome                     "\n\n\nWelcome to\n\nCallMan 1.3\n(02-23-1998)\n\n© Copyright 1997-1998 Alexander 'Sascha' Fichtner")
  25.         (set #requirements                "\n\nRequirements:\n\n- OS 3.0\n- MUI 3.3+\n- screen with at least a size of 640x256\n- a modem (optional)\n- about 700k free space on your harddisk (full installation)")
  26.         (set #installmode                 "Would you like to install CallMan from scratch, update an older version, or completely remove CallMan from your system?")
  27.         (set #installmode_install         "Install/Update")
  28.         (set #installmode_uninstall       "Un-install")
  29.         (set #default_destination         "Install: Please specify the destination path. The directory 'CallMan' will be created if it is not there.\n\nUpdate: Please specify the location where your 'CallMan' directory resides.")
  30.         (set #manual                      "The manual (in AmigaGuide format) is available in different languages. Which version would you like to install/update?")
  31.         (set #rates                       "There are different rates files for the different countries and telephone companies. Which of these rates files would you like to install/update?")
  32.         (set #catalogs                    "Which language catalogs would you like to install/update?")
  33.         (set #catalogs_where              "Where do you wish to install/update the language catalogs?")
  34.         (set #catalogs_no_locale_assign   "Can't find assign LOCALE: !\nCopying catalog files to PROGDIR:Catalogs instead.")
  35.         (set #install                     "\n\n\n\n\nI'm starting the installation now.")
  36.         (set #install_abort               "Aborted by user...")
  37.         (set #uninstall_dir               "Please specify the directory containing the CallMan main program.")
  38.         (set #really_uninstall_catalogs   "Do you REALLY want to remove the catalog files?")
  39.         (set #really_uninstall_ratesfiles "Do you REALLY want to remove the rates files?\n\n(Note: This will delete the whole 'Rates' directory including any additionally created rates files!)")
  40.         (set #really_uninstall_docs       "Do you REALLY want to remove the doc files?\n\n(Note: This will delete the whole 'Docs' directory including any additionally created files!)")
  41.         (set #really_uninstall_arexx      "Do you REALLY want to remove the arexx files?\n\n(Note: This will delete the whole 'ARexx' directory including any additionally created arexx files!)")
  42.         (set #really_uninstall_mainprgs   "Do you REALLY want to remove the main CallMan files?")
  43.     )
  44. )
  45.  
  46. (if (= @language "deutsch")
  47.     (
  48.         (set #default_language 2)
  49.         (set #default_language_guide 1)
  50.         (set #language                    "Deutsch")
  51.         (set #welcome                     "\n\n\nHerzlich willkommen zu\n\nCallMan 1.3\n(23.02.1998)\n\n© Copyright 1997-1998 Alexander 'Sascha' Fichtner")
  52.         (set #requirements                "\n\nSystemvoraussetzungen:\n\n- OS 3.0\n- MUI 3.3+\n- ein Screen mit mindestens 640x256 Screengröße\n- ein Modem (optional)\n- etwa 700k freien Speicherplatz auf Ihrer Festplatte (bei voller Installation)")
  53.         (set #installmode                 "Wollen Sie CallMan neu installieren, eine bereits installierte Version aktualisieren oder CallMan wieder aus dem System entfernen?")
  54.         (set #installmode_install         "Installieren/Aktualisieren")
  55.         (set #installmode_uninstall       "Deinstallieren")
  56.         (set #default_destination         "Neuinstallation: Bitte geben Sie das Zielverzeichnis für die Installation an. Falls noch nicht vorhanden, wird dort ein Verzeichnis 'CallMan' angelegt.\n\nAktualisierung: Bitte geben Sie den Pfad an, in dem sich ihr 'CallMan'-Verzeichnis befindet.")
  57.         (set #manual                      "Die Anleitung (im AmigaGuide-Format) liegt in mehreren Sprachen vor. Welche Version möchten Sie installieren/aktualisieren?")
  58.         (set #rates                       "Es existieren unterschiedliche Gebührendateien für die verschiedenen Länder und Telefongesellschaften. Welche der folgenden Dateien sollen installiert/aktualisiert werden?")
  59.         (set #catalogs                    "Welche Sprachkataloge möchten Sie installieren/aktualisieren?")
  60.         (set #catalogs_where              "Wohin sollen die (aktualisierten) Sprachkataloge kopiert werden?")
  61.         (set #catalogs_no_locale_assign   "Kann das Assign LOCALE: nicht finden!\nIch kopiere die Katalogdateien stattdessen nach PROGDIR:Catalogs.")
  62.         (set #install                     "\n\n\n\n\nIch beginne nun mit der eigentlichen Installation.")
  63.         (set #install_abort               "Abbruch durch Benutzer...")
  64.         (set #uninstall_dir               "Bitte wählen Sie das Verzeichnis aus, in dem sich das CallMan Hauptprogramm befindet.")
  65.         (set #really_uninstall_catalogs   "Wollen Sie Sprachkataloge WIRKLICH entfernen?")
  66.         (set #really_uninstall_ratesfiles "Wollen Sie Gebührendateien WIRKLICH entfernen?\n\n(Hinweis: Es wird das komplette 'Rates' Verzeichnis und damit auch ggf. von Ihnen zusätzlich erstellte Gebührendateien gelöscht!)")
  67.         (set #really_uninstall_docs       "Wollen Sie Anleitung(en) WIRKLICH entfernen?\n\n(Hinweis: Es wird das komplette 'Docs' Verzeichnis und damit auch ggf. von Ihnen zusätzlich erstellte Dateien gelöscht!)")
  68.         (set #really_uninstall_arexx      "Wollen Sie ARexx-Skripte WIRKLICH entfernen?\n\n(Hinweis: Es wird das komplette 'ARexx' Verzeichnis und damit auch ggf. von Ihnen zusätzlich erstellte ARexx-Skripte gelöscht!)")
  69.         (set #really_uninstall_mainprgs   "Wollen Sie die CallMan Hauptprogramme WIRKLICH entfernen?")
  70.     )
  71. )
  72.  
  73.  
  74. ; ****************************************************************************
  75. ;  install procedure
  76. ; ****************************************************************************
  77.  
  78. (procedure p_install
  79.  
  80.     ; before actually installing the files we first prompt the user
  81.     ; for all the necessary information
  82.  
  83.     ; ********************
  84.     ;  choose destination
  85.     ; ********************
  86.     (set #dest_dir
  87.         (askdir (prompt #default_destination )
  88.             (help @askdir-help)
  89.             (default @default-dest)
  90.         )
  91.     )
  92.     (set #install_dir (tackon #dest_dir "CallMan"))
  93.  
  94.     ; ***************
  95.     ;  ARexx scripts
  96.     ; ***************
  97.     (set #arexx_dir (tackon #install_dir "Arexx"))
  98.  
  99.     ; ***************
  100.     ;  choose guides
  101.     ; ***************
  102.     (set #cm_guides
  103.         (askchoice
  104.         (prompt #manual)
  105.         (help "")
  106.         (choices " English" " Deutsch")
  107.         (default #default_language_guide)
  108.         )
  109.     )
  110.     (set #guides_dir (tackon #install_dir "Docs"))
  111.  
  112.     ; ********************
  113.     ;  choose rates files
  114.     ; ********************
  115.     (set #ratesfiles
  116.         (askoptions
  117.         (prompt #rates)
  118.         (help "")
  119.         (choices " Deutsche TELEKOM" " Norske" " Telecom Italia" " Telefomica" " Telekomunikacja Polska" " UK British Telecom")
  120.         (default -1)
  121.         )
  122.     )
  123.     (set #rates_dir (tackon #install_dir "Rates"))
  124.  
  125.     ; *****************
  126.     ;  choose catalogs
  127.     ; *****************
  128.     (set #cm_language
  129.         (askoptions
  130.         (prompt #catalogs)
  131.         (help "")
  132.         (choices " English (built-in)" " Deutsch")
  133.         (default #default_language)
  134.         )
  135.     )
  136.     (if (<> #cm_language 1)
  137.         ; --> "then"
  138.         ( 
  139.             ; ****************************
  140.             ;  choose catalog destination
  141.             ; ****************************
  142.             (set #catalog_dest
  143.                 (askchoice
  144.                 (prompt #catalogs_where)
  145.                 (help "")
  146.                 (choices "LOCALE:Catalogs" "PROGDIR:Catalogs")
  147.                 (default 1)
  148.                 )
  149.             )
  150.             (if (= #catalog_dest 0)
  151.                 ; --> "then"
  152.                 (
  153.                     (set #locale_path (getassign "LOCALE"))
  154.                     (if (= #locale_path "")
  155.                         ; --> "then" (there's no LOCALE: assign)
  156.                         (
  157.                             (message #catalogs_no_locale_assign)
  158.                             (set #catalog_dest 1)
  159.                         )
  160.                     )
  161.                 )
  162.             )
  163.         )
  164.     )
  165.     (set #catalogs_dir (tackon #install_dir "Catalogs"))
  166.  
  167.  
  168.     ; now we actually start the installation
  169.  
  170.     ; ***************
  171.     ;  install files
  172.     ; ***************
  173.     (message #install)
  174.  
  175.     (complete 0)
  176.  
  177.     (makedir #install_dir (infos) )
  178.     (copylib (source "CallMan"     ) (dest #install_dir) (infos) )
  179.     (copylib (source "CM_Converter") (dest #install_dir) (infos) )
  180.     (copylib (source "Install"     ) (dest #install_dir) (infos) )
  181.  
  182.     (complete 20)
  183.  
  184.     (makedir #arexx_dir )
  185.     (copyfiles (source "ARexx") (dest #arexx_dir) (all) )
  186.  
  187.     (complete 40)
  188.  
  189.     (makedir #guides_dir (infos) )
  190.     (delete (tackon #guides_dir "CallMan_#?.guide#?") )
  191.     (if (= #cm_guides 0) (copylib (source "Docs/CallMan_UK.guide") (dest #guides_dir) (newname "CallMan.guide") (infos) ))
  192.     (if (= #cm_guides 1) (copylib (source "Docs/CallMan_D.guide")  (dest #guides_dir) (newname "CallMan.guide") (infos) ))
  193.  
  194.     (complete 60)
  195.  
  196.     (makedir #rates_dir )
  197.     (if (<> #ratesfiles 0)
  198.         ; --> "then"
  199.         (
  200.             (if (IN #ratesfiles 0) (copylib (source "Rates/DeutscheTELEKOM.rates") (dest #rates_dir) ))
  201.             (if (IN #ratesfiles 1)
  202.                 ; --> "then"
  203.                 (
  204.                     (copylib (source "Rates/NorskeBasisPriser.rates") (dest #rates_dir) )
  205.                     (copylib (source "Rates/NorskePriser.rates")      (dest #rates_dir) )
  206.                 )
  207.             )
  208.             (if (IN #ratesfiles 2) (copylib (source "Rates/TelecomItalia.rates") (dest #rates_dir) ))
  209.             (if (IN #ratesfiles 3) (copylib (source "Rates/Telefomica.rates") (dest #rates_dir) ))
  210.             (if (IN #ratesfiles 4) (copylib (source "Rates/TelekomunikacjaPolska.rates") (dest #rates_dir) ))
  211.             (if (IN #ratesfiles 5)
  212.                 ; --> "then"
  213.                 (
  214.                     (copylib (source "Rates/UK-BTbusiness.rates") (dest #rates_dir) )
  215.                     (copylib (source "Rates/UK-BTprivate.rates")  (dest #rates_dir) )
  216.                 )
  217.             )
  218.         )
  219.     )
  220.  
  221.     (complete 80)
  222.  
  223.     (if (= #catalog_dest 0)
  224.         ( ; --> "then" install in LOCALE:
  225.             (if (IN #cm_language 1)
  226.                 ; --> "then" german
  227.                 (
  228.                     (copylib (source "Catalogs/deutsch/CallMan.catalog"     ) (dest "LOCALE:Catalogs/deutsch") )
  229.                     (copylib (source "Catalogs/deutsch/CM_Converter.catalog") (dest "LOCALE:Catalogs/deutsch") )
  230.                 )
  231.             )
  232.         )
  233.         ( ; --> "else" install in PROGDIR:
  234.             (makedir #catalogs_dir )
  235.             (if (IN #cm_language 1)
  236.                 ; --> "then" german
  237.                 (
  238.                     (copylib (source "Catalogs/deutsch/CallMan.catalog"     ) (dest (tackon #catalogs_dir "deutsch")) )
  239.                     (copylib (source "Catalogs/deutsch/CM_Converter.catalog") (dest (tackon #catalogs_dir "deutsch")) )
  240.                 )
  241.             )
  242.         )
  243.     )
  244.  
  245.     (complete 100)
  246. )
  247.  
  248.  
  249. ; ****************************************************************************
  250. ;  deinstall procedure
  251. ; ****************************************************************************
  252.  
  253. (procedure p_uninstall
  254.  
  255.     (if (= @user-level 0) (user 1))
  256.  
  257.     ; ********************
  258.     ;  choose CallMan dir
  259.     ; ********************
  260.     (set #script_dir (pathonly @icon))
  261.     (set #uninstall_dir
  262.         (askdir (prompt #uninstall_dir )
  263.             (help @askdir-help)
  264.             (default #script_dir )
  265.         )
  266.     )
  267.  
  268.     ; *****************
  269.     ;  delete catalogs
  270.     ; *****************
  271.     (set #bool
  272.         (askbool
  273.             (prompt #really_uninstall_catalogs )
  274.             (help "" )
  275.             (default 1)
  276.         )
  277.     )
  278.     (if (= #bool 0) (exit #install_abort (quiet)) )
  279.     (if (exists (tackon #uninstall_dir "Catalogs"))
  280.         ( ; --> "then"
  281.             (set #catalogs_dir (tackon #uninstall_dir "Catalogs" ))
  282.             (foreach #catalogs_dir "#?"
  283.                 (
  284.                     (delete (tackon #catalogs_dir (tackon @each-name "CallMan.catalog"      ) ) )
  285.                     (delete (tackon #catalogs_dir (tackon @each-name "CM_Converter.catalog" ) ) )
  286.                     (delete (tackon #catalogs_dir @each-name ) )
  287.                 )
  288.             )
  289.             (delete #catalogs_dir )
  290.         )
  291.         ( ; --> "else"
  292.             (set #catalogs_dir "LOCALE:Catalogs" )
  293.             (foreach #catalogs_dir "#?"
  294.                 (
  295.                     (delete (tackon #catalogs_dir (tackon @each-name "CallMan.catalog"      ) ) )
  296.                     (delete (tackon #catalogs_dir (tackon @each-name "CM_Converter.catalog" ) ) )
  297.                 )
  298.             )
  299.         )
  300.     )
  301.  
  302.     ; ********************
  303.     ;  delete rates files
  304.     ; ********************
  305.     (set #bool
  306.         (askbool
  307.             (prompt #really_uninstall_ratesfiles )
  308.             (help "" )
  309.             (default 1)
  310.         )
  311.     )
  312.     (if (= #bool 0) (exit #install_abort (quiet)) )
  313.     (set #rates_dir (tackon #uninstall_dir "Rates" ))
  314.     (delete (tackon #rates_dir "#?") )
  315.     (delete #rates_dir)
  316.  
  317.     ; ***************
  318.     ;  delete guides
  319.     ; ***************
  320.     (set #bool
  321.         (askbool
  322.             (prompt #really_uninstall_docs )
  323.             (help "" )
  324.             (default 1)
  325.         )
  326.     )
  327.     (if (= #bool 0) (exit #install_abort (quiet)) )
  328.     (set #guides_dir (tackon #uninstall_dir "Docs"))
  329.     (delete (tackon #guides_dir "#?") )
  330.     (delete #guides_dir (infos) )
  331.  
  332.     ; ********************
  333.     ;  delete arexx files
  334.     ; ********************
  335.     (set #bool
  336.         (askbool
  337.             (prompt #really_uninstall_arexx )
  338.             (help "" )
  339.             (default 1)
  340.         )
  341.     )
  342.     (if (= #bool 0) (exit #install_abort (quiet)) )
  343.     (set #arexx_dir (tackon #uninstall_dir "ARexx"))
  344.     (delete (tackon #arexx_dir "#?") )
  345.     (delete #arexx_dir (infos) )
  346.  
  347.     ; ****************
  348.     ;  delete CallMan
  349.     ; ****************
  350.     (set #bool
  351.         (askbool
  352.             (prompt #really_uninstall_mainprgs )
  353.             (help "" )
  354.             (default 1)
  355.         )
  356.     )
  357.     (if (= #bool 0) (exit #install_abort (quiet)) )
  358.     (set #Install (tackon #uninstall_dir "Install"      ))
  359.     (set #Convert (tackon #uninstall_dir "CM_Converter" ))
  360.     (set #CallMan (tackon #uninstall_dir "CallMan"      ))
  361.     (delete #Install      (infos) )
  362.     (delete #Convert      (infos) )
  363.     (delete #CallMan      (infos) )
  364.  
  365.     ; **************************
  366.     ;  remove CallMan directory
  367.     ; **************************
  368.     (delete #uninstall_dir )
  369. )
  370.  
  371.  
  372. ; ****************************************************************************
  373. ;  MAIN
  374. ; ****************************************************************************
  375.  
  376. (message #welcome)
  377. (message #requirements)
  378.  
  379. ; *******************************************
  380. ;  choose mode (install, update or deinstall)
  381. ; *******************************************
  382. (set #mode
  383.     (askchoice
  384.     (prompt #installmode )
  385.     (help "" )
  386.     (choices #installmode_install #installmode_uninstall )
  387.     (default 0)
  388.     )
  389. )
  390. (welcome)
  391.  
  392. (if (= #mode 0)
  393.     ( ; --> "then"
  394.         (p_install)
  395.     )
  396. )
  397.  
  398. (if (= #mode 1)
  399.     ( ; --> "then"
  400.         (p_uninstall)
  401.     )
  402. )
  403.  
  404.  
  405.